import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        // 初始化测试数据
        DVDModel dvdModel = new DVDModel();
        DVDModel a = new DVDModel(1, "泰坦尼克号", 39.9);
        DVDModel b = new DVDModel(2, "阿凡达", 49.99);
        DVDModel c = new DVDModel(3, "星际穿越", 45.0);

        // 展示所有电影简略信息
        System.out.println("===== 全部电影列表 =====");
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);

        // 获取用户输入
        Scanner scanner = new Scanner(System.in);
        System.out.print("\n请输入要查询的电影编号：");
        int searchId = scanner.nextInt();

        // 查询并展示详细信息
        if(searchId ==1){
            System.out.println(a.getName());
            System.out.println(a.getPrice());
        }else if(searchId == 2){
            System.out.println(b.getName());
            System.out.println(b.getPrice());
        }else if(searchId == 3){
            System.out.println(c.getName());
            System.out.println(c.getPrice());
        }else {

        }

    }
}
